<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta name="content-type" content="text/html; charset=UTF-8" />
    <title>后台用户管理</title>
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}" type="text/css" media="screen" />
    <script type="text/javascript" th:src="@{/jquery/jquery-1.12.4.min.js}"></script>
    <script type="text/javascript" th:src="@{/bootstrap/js/bootstrap.min.js}"></script>

</head>
<body>


<div class="panel panel-default">
    <ol class="breadcrumb">
        <li class="active">后台用户列表</li>
    </ol>

    <div style="padding: 10px">
        <!-- Table -->
        <table class="table table-striped">
            <tr>
                <th><span>ID</span></th>
                <th><span>用户账号</span></th>
                <th><span>密码</span></th>
                <th><span>身份</span></th>
                <th><span>操作</span></th>
            </tr>
            <th:block th:if="${not #lists.isEmpty(userList)}">
                <tr th:each="user : ${userList}">
                    <form id="updateForm" method="get" action="/admin/user/modifyAdminUser">
                        <td th:text="${user.id}"></td>
                        <td th:text="${user.loginName}"></td>
                        <td>
                            <input type="text" name="password" class="form-control" th:value="${user.password}">
                        </td>
                        <td>
                            <select name="groupId" class="form-control">
                                <option value="2" th:selected="${user.groupId == 2}" th:text="超级管理员"></option>
                                <option value="3" th:selected="${user.groupId == 3}" th:text="普通管理员"></option>
                            </select>
                        </td>
                        <td>
                            <input type="hidden" name="userId" class="form-control" th:value="${user.id}">
                            <button class="btn btn-default" type="submit">修改</button>
                        </td>
                    </form>
                </tr>
            </th:block>
        </table>
    </div>

    <ul class="pager">
        <li id="liPrePage">
            <a th:if="${not isFirstPage}"
               th:href="@{${'/admin/user/'}(pageNum=${pageNum-1},pageSize=${pageSize})}">
                <
            </a>
            <a th:if="${isFirstPage}" href="javascript:void(0);">
                <
            </a>
        </li>
        <li id="liNextPage">
            <a th:if="${not isLastPage}"
               th:href="@{${'/admin/user/'}(pageNum=${pageNum+1},pageSize=${pageSize})}">
                >
            </a>
            <a th:if="${isLastPage}" href="javascript:void(0);">
                >
            </a>
        </li>
    </ul>

</div>

</body>
</html>